#!/bin/bash

echo -e "\033[1;41;33m[ sample: ./3.shell/mysql-import.sh -d supreme_dev ]\033[0m"

host=127.0.0.1
port=3306
username=root
password=111111

while getopts "h:p:u:a:" opt; do
  case $opt in
    h)
        host=$OPTARG
        ;;
    p)
        port=$OPTARG
        ;;
    u)
        username=$OPTARG
        ;;
    a)
        password=$OPTARG
        ;;
    \?)
        echo "invalid arg"
        exit 1
        ;;
  esac
done

echo "$host $port $username $password"
#mysql -h"$host" -P"$port" -u"$username" -p"$password"